#include "mainwindow.h"
#include <QApplication>
#include "CxSystemBuilder.h"
#include <QSplashScreen>
void ConnectFunc(bool is)
{

}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    qRegisterMetaType<cv::Mat>("cv::Mat");

    QSplashScreen *spl=new QSplashScreen;

    spl->setPixmap(QPixmap(":/Image/MyImage/_Resource/Slp2.jpg"));

    spl->show();

    Qt::Alignment bottom=Qt::BottomSection;
    spl->showMessage("现在正在启动程序",bottom);

    boost::this_thread::sleep(boost::posix_time::seconds(1));

    MainWindow w;

    CxSystemBuilder *builder=new CxSystemBuilder;

    for(int i=0;i<4;++i)
    {
        builder->sig_showFunc[i].connect(boost::bind(&MainWindow::showImage,boost::ref(w),i,_1));
        builder->sig_showcountFunc[i].connect(boost::bind(&MainWindow::showCarcount,boost::ref(w),i,_1,_2));
        builder->sig_dbconnectFunc[i].connect(ConnectFunc);
    }

    w.show();

    spl->finish(&w);
    delete spl;
    int result = a.exec();
    delete builder;

    return result;
}
